package com.lcx.gmall.service.Impl;


import com.lcx.gmall.bean.UserAddress;
import com.lcx.gmall.service.OrderService;
import com.lcx.gmall.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*
* 1.将服务提供者注册到服务中心（暴露服务）
*   1）,导入dubbo依赖（2.6.2）\操作zookeeper的哭护短（curator)
*   2)，配置服务提供者
* 2.让消费者去注册中心订阅服务提供者的服务地址
*/
@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    UserService userService;

    @Override
    public List<UserAddress> initOrder(String userId) {
        System.out.println("用户id"+userId);
        List<UserAddress> userAddressList = userService.getUserAddressList(userId);
        for (UserAddress userAddress:userAddressList) {
            System.out.println(userAddress.getUserAddress());
        }
        return userAddressList;
    }
}
